home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
El Mac 1
/
Magazine.iso
/
EL MAC 1
/
Shareware
/
HyperCard
/
XCMD Docs
/
CompileIt! Source Code
/
SimpleForm(num,den)
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
Text File
|
1995-08-19
|
304 b
|
14 lines
|
[
TEXT/ttxt
]
function SimpleForm num,den
put num*1 into x
put den*1 into y
if x>y then put y into z
else put x into z
repeat with n=z down to 2
if x mod n=0 and y mod n=0 then
put x div n into x
put y div n into y
exit repeat
end if
end repeat
return x & "/" & y
end SimpleForm